<include file="Public:header" />
<div class="container">
  <div class="mainbody"> <include file="Public:exchangemenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>{$title}--商品列表</h2>
        <form method="POST" action="" style="margin-left:100px;">
          <input type="text"  class="searcheTxt" placeholder="请输入商品名称" name="keys" id="keys" value="<?php echo $_REQUEST['keys']?>">
          <button type="button" onclick="changeSelect()" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search"></span> 搜索</button>
        </form>
        <p class="text-right function"> <a href="__URL__/productAdd?sid={$_GET['id']}" class="btn btn-info btn-sm" title="添加商品"><span class="glyphicon glyphicon-plus"></span> 添加商品</a> </p>
      </div>
      <div class="detail">
        <div id="tabCot_product_1" class="tabCot" >
          <table cellspacing="0" cellpadding="0" width="100%" border="0" class="tabindex table-hover">
            <tbody>
              <tr>
                <th>编号</th>
                <th>商品名</th>
                <th>价格</th>
                <th>消耗积分</th>
				<th>总数</th>
				<th>已兑换</th>
				<th>是否打折</th>
                <th>创建时间</th>
                <th style="width:300px;">操作</th>
              </tr>
              <volist name="list" id="vo" key="key">
                <tr>
                  <td>{$key}</td>
                  <td> {$vo.title} </td>
                  <td> ￥{$vo.price}</td>
                  <td>{$vo.score}</td>
				  <td>{$vo.total}</td>
				  <td>{$vo.num}</td>
				  <td>{$vo['issale'] ==1 ? '是' :'否'}</td>
                  <td>{$vo.ctime}</td>
                  <td><a href="__URL__/productAdd?id={$vo.id}" title="修改商品">修改</a>&nbsp;|&nbsp; <a href="javascript:confirmDelete({$vo.id});" title="删除商品">删除</a></td>
                </tr>
              </volist>
            </tbody>
          </table>
          <div class="manu"> {$page} </div>
        </div>
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" /> 
<script type="text/javascript">

	
function changeSelect() {
	var keys = $('#keys').val();
    location.href = "__URL__/productList?keys=" + keys+"&id=<?php echo $_GET['id']?>" ;
}


function confirmDelete(id){
if (confirm("确认要删除这条数据吗？")) {
       location.href="__URL__/productDel?id="+id+"&sid=<?php echo $_GET['id']?>" ;
     }
}



</script>